package cz.matasek.dbLogger.sql;

/**
 * Enumeration of keywords used as replacement tag in SQL statements.
 *
 * @author Luboš Matásek
 */
public enum ReplacementKeyword {

    /**
     * Column name.
     */
    COLUMN_NAME,
    /**
     * Column names.
     */
    COLUMN_NAMES,
    /**
     * Column values.
     */
    COLUMN_VALUES,
    /**
     * History table columns.
     */
    HISTORY_TABLE_COLUMNS,
    /**
     * History trigger loop.
     */
    HISTORY_TRIGGER,
    /**
     * History table name.
     */
    HISTORY_TABLE_NAME,
    /**
     * Logging table name.
     */
    LOGGING_TABLE_NAME,
    /**
     * Logging trigger loop for new values.
     */
    LOGGING_TRIGGER_LOOP_NEW,
    /**
     * Logging trigger loop for old values.
     */
    LOGGING_TRIGGER_LOOP_OLD,
    /**
     * Prefix.
     */
    PREFIX,
    /**
     * Prefix function name.
     */
    PREFIX_FUNCTION_NAME,
    /**
     * Sequence name.
     */
    SEQUENCE_NAME,
    /**
     * Table name.
     */
    TABLE_NAME,
    /**
     * Trigger events.
     */
    TRIGGER_EVENTS,
    /**
     * Trigger name.
     */
    TRIGGER_NAME,
    /**
     * Type.
     */
    TYPE,
    /**
     * Where clause.
     */
    WHERE_CLAUSE;
    /**
     * Keyword delimiter.
     */
    private static final String KEYWORD_DELIMITER = "%";

    /**
     * Returns string representation of the keyword.
     *
     * @return SQL statement keyword
     */
    @Override
    public String toString() {
        return KEYWORD_DELIMITER + name() + KEYWORD_DELIMITER;
    }
}
